package com.yuma.storage.controller;

import com.yuma.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StorageController {
    @Autowired
    private StorageService storageService;
    /**
     * 减少库存
     */
    @GetMapping("/deduct")
    public String deduct(Long productId,Integer total){
        storageService.updateByProductId(productId,total);
        return "库存扣减成功";
    }
}
